package cn.bugstack.domain.strategy.model.entity;

import cn.bugstack.domain.strategy.model.valobj.RuleLogicCheckTypeVO;
import lombok.*;

/**
 * @Author: Zchy
 * @Description: 规则动作实体，用于返回规则处理结果
 * @DateTime: 10/28/2024 6:06 PM
 **/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class RuleActionEntity<T extends RuleActionEntity.RaffleEntity> {

    private String code = RuleLogicCheckTypeVO.ALLOW.getCode();
    private String info = RuleLogicCheckTypeVO.ALLOW.getInfo();
    private String ruleModel;
    private T data;

    static public class RaffleEntity {

    }

    @EqualsAndHashCode(callSuper = true)
    @Data
    @Builder
    @AllArgsConstructor
    @NoArgsConstructor
    static public class RaffleBeforeEntity extends RaffleEntity{
        private Long strategyId;
        //抽奖前的规则权重值
        private String ruleWeightValueKey;
        //黑名单过滤的奖品ID
        private Integer awardId;
    }

    static public class RaffleCenterEntity extends RaffleEntity{
        private Long strategyId;
        private String ruleWeightValueKey;
        private Integer awardId;
    }

    static public class RaffleAfterEntity extends RaffleEntity{
        private Long strategyId;
        private String ruleWeightValueKey;
        private Integer awardId;
    }
}
